#if !defined(AFX_COMMSOCKET_H__37985B29_F325_11D3_81DE_00C04F885AD7__INCLUDED_)
#define AFX_COMMSOCKET_H__37985B29_F325_11D3_81DE_00C04F885AD7__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// CommSocket.h : header file
//
#include "ConstantValue.h"
#include "ICommSocket.h"

class CSystemData;
class CMoldingOHTDoc;

/////////////////////////////////////////////////////////////////////////////
// CCommSocket command target

class CCommSocket : public CAsyncSocket, public ICommSocket
{
private:

// Attributes
public:

// Operations
public:
	CCommSocket();
	virtual ~CCommSocket();

// Overrides
public:
	int ReceiveData(char* szData, int nLength);
	void SetPortInfor(CString strServerIP, int nPortNo);
	int SockConnect();
	int SockClose();
	int SetHandle(HWND hWnd);
	int SendData(CString strData);

	//////////////////////////////////////////////////////////////////////////
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CCommSocket)
	public:
	virtual void OnClose(int nErrorCode);
	virtual void OnConnect(int nErrorCode);
	virtual void OnReceive(int nErrorCode);
	//}}AFX_VIRTUAL

	// Generated message map functions
	//{{AFX_MSG(CCommSocket)
		// NOTE - the ClassWizard will add and remove member functions here.
	//}}AFX_MSG

// Implementation
protected:
	CMoldingOHTDoc* m_pDoc;

private:
	CString m_strServerIP;
	int		ErrorResponse();
	int		m_nPortNo;
	HWND	m_hEQWnd;
	int		m_nLastErrorCode;
	CString m_strErrorDesp;
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_COMMSOCKET_H__37985B29_F325_11D3_81DE_00C04F885AD7__INCLUDED_)
